---
import { getCollection, getEntry } from 'astro:content';
import Layout from '../layouts/Layout.astro';
import { PagesNavigationFromLocalStorage } from '@features/pages-navigation/components/PagesNavigationFromLocalStorage';
import { getDocsPages } from '../features/docs/utils/pageData';
import type { Framework, MenuSection } from '@ag-grid-types';
import { Pipeline } from '@components/pipeline/Pipeline';

export async function getStaticPaths() {
    const pages = await getCollection('docs');
    return getDocsPages(pages);
}

const pageName = Astro.params.pageName as Framework;

const { data: menu } = await getEntry('menu', 'data');
const allMenuSections = menu.main.sections as MenuSection[];
---

<Layout title={'AG Grid Pipeline'} showDocsNav={true} showSearchBar={true}>
    <div class:list={['contentViewport layout-grid']}>
        <PagesNavigationFromLocalStorage client:load allMenuSections={allMenuSections} pageName={pageName} />

        <main is="div">
            <Pipeline client:only />
        </main>
    </div>
</Layout>
